﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Media;
using System.Timers;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Spelprojekt
{
    /*! Spindelklassen. Sköter rörelse och slump-positionsgenerering vid skapande*/
    class Spider1
    {
        public bool dead = false;
        public Rectangle SpiderRectangle = new Rectangle(800, 0, 31, 18);
        private int speedY = 1;
        private int speedAdder = 1;
        public int gameOverFalling;
        Random slump = new Random();
        public Spider1()
        {
            gameOverFalling = slump.Next(-60, -20);
            SpiderRectangle.Y = slump.Next(15, 440);
        }
        public void Move() /*! Rörelsefunktion för en spindel.*/
        {
            SpiderRectangle.X += -1;
            SpiderRectangle.Y += speedY;
            if(speedY == 8 || speedY == -8)
                speedAdder = speedAdder * (-1);

            speedY += speedAdder;
        }
    }
}
